class CommonWebsitModel {
  String? errorMsg;
  int? errorCode;
  List<DataListBean>? data;

  CommonWebsitModel({this.errorMsg, this.errorCode, this.data});

  factory CommonWebsitModel.fromMap(Map<String, dynamic> map) {
    return CommonWebsitModel(
      errorMsg: map['errorMsg'],
      errorCode: map['errorCode'],
      data: map['data'] != null ? DataListBean.fromMapList(map['data']) : [],
    );
  }

  static List<CommonWebsitModel> fromMapList(dynamic mapList) {
    if (mapList == null) return [];
    return List<CommonWebsitModel>.from(mapList.map((map) => CommonWebsitModel.fromMap(map)));
  }
}

class DataListBean {
  String? icon;
  String? link;
  String? name;
  int? id;
  int? order;
  int? visible;

  DataListBean({this.icon, this.link, this.name, this.id, this.order, this.visible});

  factory DataListBean.fromMap(Map<String, dynamic> map) {
    return DataListBean(
      icon: map['icon'],
      link: map['link'],
      name: map['name'],
      id: map['id'],
      order: map['order'],
      visible: map['visible'],
    );
  }

  static List<DataListBean> fromMapList(dynamic mapList) {
    if (mapList == null) return [];
    return List<DataListBean>.from(mapList.map((map) => DataListBean.fromMap(map)));
  }

  Map<String, dynamic> toMap() {
    return {
      "icon": icon,
      "link": link,
      "name": name,
      "id": id,
      "web_order": order,
      "visible": visible,
    };
  }
}
